import javax.lang.model.type.WildcardType;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.Type;

/*
public class Student<T> {
    @Range(min = 5, max = 20)
    int stuAge;

    @Range(min = 2, max = 10)
    String stuName;

    public Student(int stuAge, String stuName) {
        this.stuAge = stuAge;
        this.stuName = stuName;
    }

    @SuppressWarnings("unchecked")
    T[] createArray(Class<T> cls) {
        return (T[]) Array.newInstance(cls, 5);
    }

    void check() throws IllegalArgumentException, ReflectiveOperationException {
        for(Field f: this.getClass().getDeclaredFields()) {
            Range range = f.getAnnotation(Range.class);
            if(range != null) {
                Object value = f.get(this);
                if(value instanceof String str) {
                    if(str.length() < range.min() || str.length() > range.max()) {
                        throw new IllegalArgumentException("Parameter length does not meet requirements");
                    }
                }
                if(value instanceof Integer number) {
                    if(number < range.min() || number > range.max()) {
                        throw new IllegalArgumentException("Parameter value does not meet requirements");
                    }
                }
            }
        }
    }
}
*/